﻿/*

Copyright 2009 Guillaume Amringer

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

*/

package {
	import flash.display.MovieClip;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFormat;
	import lt.uza.utils.Global;
	
	public class MenuBox extends MovieClip {
		
		private var _menuBox:MovieClip = new MovieClip();
		private var _menuTF:TextField = new TextField();
		private var _menuTFormat:TextFormat =  new TextFormat('Mangal', 10, 0xffffff);
		
		public var globals:Global = Global.getInstance();
		
		public function MenuBox():void {
			
			//	Prepare menu box
			_menuTF.defaultTextFormat = _menuTFormat;
			_menuTF.autoSize = TextFieldAutoSize.CENTER;
			_menuTF.text = 'Menu';
			_menuBox.graphics.lineStyle(1, 0xffffff);
			_menuBox.graphics.beginFill(0x3f2f30);
			_menuBox.graphics.drawRect(-1, -1, 100, 23);
			_menuBox.graphics.endFill();
			_menuBox.addChild(_menuTF);
			
			this.addChild(_menuBox);
		}
		
		public function changetext(pText:String):void {
			
			_menuTF.text = pText;
		}
	}
}